package com.tzpay.tzpay.view;

import android.content.Context;
import android.os.Bundle;
import android.support.v7.app.AlertDialog;
import android.text.TextUtils;
import android.widget.TextView;

import com.tzpay.tzpay.R;

public class DilatingDotsDialog extends AlertDialog {

    private CharSequence message;

    private TextView textViewMessage;
//    private DilatingDotsProgressBar mDilatingDotsProgressBar;

    public DilatingDotsDialog(Context context) {
        this(context, R.style.DilatingDotsDialog);
    }

    public DilatingDotsDialog(Context context, CharSequence message) {
        this(context);
        this.message = message;
    }

    public DilatingDotsDialog(Context context, CharSequence message, int theme) {
        this(context, theme);
        this.message = message;
    }

    public DilatingDotsDialog(Context context, int theme) {
        super(context, theme);
    }

    public DilatingDotsDialog(Context context, boolean cancelable, OnCancelListener cancelListener) {
        super(context, cancelable, cancelListener);
    }

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);

        setContentView(R.layout.dilating_dots_dialog);
        setCanceledOnTouchOutside(false);
//        mDilatingDotsProgressBar = (DilatingDotsProgressBar) findViewById(R.id.progress);
        initMessage();
    }

    @Override
    protected void onStart() {
        super.onStart();
    }

    @Override
    protected void onStop() {
        super.onStop();

    }

    @Override
    public void show() {
        super.show();
//        mDilatingDotsProgressBar.showNow();
    }

    @Override
    public void dismiss() {
        super.dismiss();
//        mDilatingDotsProgressBar.hideNow();
    }

    @Override
    public void setMessage(CharSequence message) {
        textViewMessage.setText(message);
    }

    private void initMessage() {
        textViewMessage = (TextView) findViewById(R.id.dmax_spots_title);

        if (!TextUtils.isEmpty(message)) {
            textViewMessage.setText(message);
        }
    }

//    public DilatingDotsProgressBar getmDilatingDotsProgressBar() {
//        return mDilatingDotsProgressBar;
//    }
//
//    public void setmDilatingDotsProgressBar(DilatingDotsProgressBar mDilatingDotsProgressBar) {
//        this.mDilatingDotsProgressBar = mDilatingDotsProgressBar;
//    }
}
